<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:replace="~{/_include/header}" />
    <title>客户池</title>
</head>
<body>
<div class="rb-wrapper rb-fixed-sidebar rb-collapsible-sidebar rb-collapsible-sidebar-hide-logo rb-color-header" th:classappend="${sideCollapsedClazz}">
          <th:block th:replace="~{/_include/nav-top}" />
    <th:block th:replace="~{/_include/nav-left-admin(active='selectAccountTeamForAdmin')}" />
    <div class="rb-content">
        <div class="main-content container-fluid">
            <ul class="nav nav-tabs nav-tabs-classic">
                <li class="nav-item">
                    <a href="#selectAccountTeamForAdmin" data-toggle="tab" class="nav-link active">客户池</a>
                </li>
                <li class="nav-item">
                    <a href="#limit" data-toggle="tab" class="nav-link">领取数量限制</a>
                </li>
                <li class="nav-item">
                    <a href="#receiveRules" data-toggle="tab" class="nav-link">客户领取规则</a>
                </li>
                <li class="nav-item">
                    <a href="#recoveryRules" data-toggle="tab" class="nav-link ">客户回收规则</a>
                </li>
            </ul>
            <div class="card card-table">
                <div class="card-body">
                    <div class="tab-content">
                        <div class="tab-pane active" id="selectAccountTeamForAdmin">
                            <div class="dataTables_wrapper container-fluid">
                                <div class="row rb-datatable-header">
                                    <div class="col-12 col-md-6">
                                        <div class="dataTables_filter">
                                            <div class="input-group input-search">
                                                <input class="form-control" type="text" placeholder="请输入客户组名称" maxlength="40" data-quickFields="" />
                                                <span class="input-group-btn">
                                                  <button class="btn btn-secondary" type="button"><i class="icon zmdi zmdi-search"></i></button>
                                                </span>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-12 col-md-6">
                                        <div class="dataTables_oper">
                                            <button class="btn btn-space btn-primary J_new" type="button"><i class="icon zmdi zmdi-plus"></i> 新建</button>
                                            <button class="btn btn-space btn-primary J_transfer_group_customer" type="button"><i class="icon zmdi zmdi-mail-reply-all"></i> 转移分组</button>
                                            <button class="btn btn-space btn-secondary J_edit" type="button"><i class="icon zmdi zmdi-edit"></i> 编辑</button>
                                            <button class="btn btn-space btn-secondary J_delete_customer_get" type="button"><i class="icon zmdi zmdi-delete"></i> 删除</button>
                                        </div>
                                    </div>
                                </div>
                                <div id="react-list" class="rb-loading rb-loading-active data-list">
                                    <th:block  th:replace="~{/_include/spinner}" />
                                </div>
                            </div>
                        </div>
                        <div class="tab-pane" id="limit">
                            <div class="well well-lg">
                                <h4>领取数量限制</h4>
                                <p>
                                    注：<br>
                                    1、客户保有量上限是员工可以保有的最大客户数。<br>
                                    2、客户限制的数量不包含被分配和转移的客户。（即为领取客户上限仅包括自领取数量上限）<br>
                                    3、不在规则中的角色无保有量限制。
                                </p>
                            </div>
                            <form class="form simple">
                                <div class="form-group row">
                                    <label class="col-sm-3 col-form-label text-sm-right">领取数量限制开关</label>
                                    <div class="col-sm-7">
                                        <div class="mt-1">
                                            <label class="custom-control custom-control-sm custom-checkbox" id="checkboxLimit" >
                                                <input class="custom-control-input" type="checkbox">
                                                <span class="custom-control-label"></span>
                                            </label>
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group row">
                                    <label class="col-sm-3 col-form-label text-sm-right"></label>
                                    <div class="col-sm-7" id="tableLimit">
                                        <table class="table table-bordered table-striped table-hover">
                                            <thead>
                                            <tr>
                                                <th>角色名</th>
                                                <th>领取数量上限（条）</th>
                                                <th>操作</th>
                                            </tr>
                                            </thead>
                                            <tbody id="tbodyLimit">
                                            <tr>
                                                <td style="text-align: center" colspan="3">暂无数据</td>
                                            </tr>
                                            </tbody>
                                        </table>
                                        <div style="margin-top: 10px">
                                            <a href="javascript:;" id="addRules">添加新限制规则</a>
                                        </div>
                                    </div>
                                </div>
                            </form>
                        </div>
                        <div class="tab-pane" id="receiveRules">
                            <form class="form simple">
                                <div class="form-group row">
                                    <label class="col-sm-3 col-form-label text-sm-right">选择周期</label>
                                    <div class="col-sm-7">
                                        <div class="mt-1" id="receiveRulesRadioGroup">
                                            <label class="custom-control custom-control-sm custom-radio custom-control-inline">
                                                <input class="custom-control-input" value="week" checked name="cycle" type="radio" />
                                                <span class="custom-control-label">每周</span>
                                            </label>
                                            <label class="custom-control custom-control-sm custom-radio custom-control-inline">
                                                <input class="custom-control-input" value="month" name="cycle" type="radio" />
                                                <span class="custom-control-label">每月</span>
                                            </label>
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group row">
                                    <label class="col-sm-3 col-form-label text-sm-right">数量限制</label>
                                    <div class="col-sm-4">
                                        <div class="input-group input-group-sm">
                                            <div class="input-group-prepend">
                                                <span class="input-group-text">最多领取</span>
                                            </div>
                                            <input type="number" id="qLimit" value="0" class="form-control" placeholder="" />
                                            <div class="input-group-append">
                                                <span class="input-group-text">次</span>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </form>
                        </div>
                        <div class="tab-pane" id="recoveryRules">
                            <div class="well well-lg">
                                <h4>规则说明</h4>
                                <div style="padding-top: 8px">
                                    <h5>手动回收</h5>
                                    <p>
                                        客户池负责人手动回收客户：是该客户经过一段时间后，没有任何进展，客户池分组负责人判断，该条客户在当前时刻，生成商机的概率低，则将此条客户回收至客户池存放，不再作为当前重点客户跟进。
                                    </p>
                                </div>
                                <div>
                                    <h5>自动回收</h5>
                                    <p>
                                        系统会根据设置的回收规则进行 ，回收规则分别为：获取之后N天没有跟进、距上次跟进 N天没有再次跟进，还可进行其他设置；例如，退回之后N天不能重复认领（ 认领（ 认领（ 此项设置为客户的前负责人N天不能认领此客户 ，其他用户仍然可认领）。
                                    </p>
                                </div>
                            </div>
                            <form class="form simple">
                                <div class="form-group row">
                                    <label class="col-sm-3 col-form-label text-sm-right">开启自动回收</label>
                                    <div class="col-sm-4">
                                        <div class="mt-1">
                                            <label class="custom-control custom-control-sm custom-checkbox custom-control-inline" id="openAuthRecovery" >
                                                <input class="custom-control-input" type="checkbox">
                                                <span class="custom-control-label"></span>
                                            </label>
                                        </div>
                                    </div>
                                </div>
                                <div id="displayAuto">
                                    <div class="form-group row">
                                        <label class="col-sm-3 col-form-label text-sm-right">一般规则</label>
                                        <div class="col-sm-7">
                                            <table class="table table-bordered table-hover">
                                                <thead>
                                                <tr>
                                                    <th>规则名称</th>
                                                    <th>条件</th>
                                                </tr>
                                                </thead>
                                                <tbody id="tbodyRule1">
                                                <td style="text-align: center" colspan="2">暂无数据</td>
                                                </tbody>
                                            </table>
                                        </div>
                                    </div>
                                    <div class="form-group row">
                                        <label class="col-sm-3 col-form-label text-sm-right">其他规则</label>
                                        <div class="col-sm-7">
                                            <table class="table table-bordered table-hover">
                                                <thead>
                                                <tr>
                                                    <th width="150px">规则名称</th>
                                                    <th>条件</th>
                                                </tr>
                                                </thead>
                                                <tbody id="tbodyRule2">
                                                <td style="text-align: center" colspan="2">暂无数据</td>
                                                </tbody>
                                            </table>
                                        </div>
                                    </div>
                                    <div class="form-group row">
                                        <label class="col-sm-3 col-form-label text-sm-right">客户锁</label>
                                        <div class="col-sm-7">
                                            <div class="input-group input-group-sm">
                                                <div class="input-group-prepend">
                                                    <span class="input-group-text">每人最多锁定</span>
                                                </div>
                                                <input id="lockRule" type="number" onblur='handleBlurBlurLock(this)' value="0" class="form-control" placeholder="" />
                                                <div class="input-group-append">
                                                    <span class="input-group-text">个</span>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<th:block th:replace="~{/_include/footer}" />
<script>
    window.__PageConfig = {
        type: 'RecordList',
        entity: ['[[${entityName}]]', '[[${entityLabel}]]', '[[${entityIcon}]]'],
        listConfig: _$unthy('[[${DataListConfig}]]'),
        advFilter: false,
        requestSource: 'account-team',
        addUrl: '/accountTeam/addAccountTeamForAdmin',
        updateUrl: '/accountTeam/updateAccountTeamForAdmin'
    }
</script>
<script th:src="@{/assets/js/xianniu/xn-datalist.js}" type="text/babel"></script>
<script th:src="@{/assets/js/xianniu/xn-forms.js}" type="text/babel"></script>
<script th:src="@{/assets/js/xianniu/xn-forms.append.js}" type="text/babel"></script>
<script th:src="@{/assets/js/xianniu/xn-account.js}" type="text/babel"></script>
<script th:src="@{/assets/js/rb-assignshare.js}" type="text/babel"></script>
<script th:src="@{/assets/js/xianniu/account.js}" type="text/babel"></script>
<script type="text/babel">


</script>
</body>
</html>
